using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._FindLocations
{
    /// <summary>
    /// <para>Find Similar Locations</para>
    /// <para>Identifies the candidate features that are most similar or dissimilar to one or more input features based on feature attributes.</para>
    /// <para>根据要素属性识别与一个或多个输入要素最相似或最不相似的候选要素。</para>
    /// </summary>    
    [DisplayName("Find Similar Locations")]
    public class FindSimilarLocations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FindSimilarLocations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The reference layer (or a selection on a layer) containing the features to be matched. The tool searches for other features similar to these features. When more than one feature is provided, matching is based on attribute averages.</para>
        /// <para>包含要匹配的要素的参考图层（或图层上的选择）。该工具将搜索与这些功能类似的其他功能。当提供多个要素时，匹配将基于属性平均值。</para>
        /// </param>
        /// <param name="_search_layer">
        /// <para>Search Layer</para>
        /// <para>The candidate layer (or a selection on a layer) containing candidate-matching features. The tool searches for features most similar (or dissimilar) to the Input Layer parameter among these candidates.</para>
        /// <para>包含候选匹配要素的候选图层（或图层上的选择）。该工具将在这些候选要素中搜索与输入图层参数最相似（或最不相似）的要素。</para>
        /// </param>
        /// <param name="_output_name">
        /// <para>Output Name</para>
        /// <para>The name of the output feature class. The output feature class contains a record for each of the Input Layer parameters and for all the solution-matching features found.</para>
        /// <para>输出要素类的名称。输出要素类包含每个输入图层参数以及找到的所有解决方案匹配要素的记录。</para>
        /// </param>
        /// <param name="_analysis_fields">
        /// <para>Analysis Fields</para>
        /// <para>A list of numeric attributes representing the matching criteria.</para>
        /// <para>表示匹配条件的数值属性列表。</para>
        /// </param>
        public FindSimilarLocations(object _input_layer, object _search_layer, object _output_name, List<object> _analysis_fields)
        {
            this._input_layer = _input_layer;
            this._search_layer = _search_layer;
            this._output_name = _output_name;
            this._analysis_fields = _analysis_fields;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Find Similar Locations";

        public override string CallName => "geoanalytics.FindSimilarLocations";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _search_layer, _output_name, _analysis_fields, _most_or_least_similar.GetGPValue(), _match_method.GetGPValue(), _number_of_results, _append_fields, _output, _data_store.GetGPValue()];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The reference layer (or a selection on a layer) containing the features to be matched. The tool searches for other features similar to these features. When more than one feature is provided, matching is based on attribute averages.</para>
        /// <para>包含要匹配的要素的参考图层（或图层上的选择）。该工具将搜索与这些功能类似的其他功能。当提供多个要素时，匹配将基于属性平均值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Search Layer</para>
        /// <para>The candidate layer (or a selection on a layer) containing candidate-matching features. The tool searches for features most similar (or dissimilar) to the Input Layer parameter among these candidates.</para>
        /// <para>包含候选匹配要素的候选图层（或图层上的选择）。该工具将在这些候选要素中搜索与输入图层参数最相似（或最不相似）的要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _search_layer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the output feature class. The output feature class contains a record for each of the Input Layer parameters and for all the solution-matching features found.</para>
        /// <para>输出要素类的名称。输出要素类包含每个输入图层参数以及找到的所有解决方案匹配要素的记录。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_name { get; set; }


        /// <summary>
        /// <para>Analysis Fields</para>
        /// <para>A list of numeric attributes representing the matching criteria.</para>
        /// <para>表示匹配条件的数值属性列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Analysis Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _analysis_fields { get; set; }


        /// <summary>
        /// <para>Most Or Least Similar</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the features to be found are most similar or least similar to the Input Layer parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Most similar—Finds the features that are most similar.</bullet_item><para/>
        ///     <bullet_item>Least similar—Finds the features that are least similar.</bullet_item><para/>
        ///     <bullet_item>Both—Finds the features that are most similar and the features that are least similar.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要查找的要素是与输入图层参数最相似还是最不相似。</para>
        ///   <bulletList>
        ///     <bullet_item>最相似 - 查找最相似的要素。</bullet_item><para/>
        ///     <bullet_item>最不相似 - 查找最不相似的要素。</bullet_item><para/>
        ///     <bullet_item>两者 （Both） - 查找最相似的要素和最不相似的要素。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Most Or Least Similar")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _most_or_least_similar_value _most_or_least_similar { get; set; } = _most_or_least_similar_value._MOST_SIMILAR;

        public enum _most_or_least_similar_value
        {
            /// <summary>
            /// <para>Most similar</para>
            /// <para>Most similar—Finds the features that are most similar.</para>
            /// <para>最相似 - 查找最相似的要素。</para>
            /// </summary>
            [Description("Most similar")]
            [GPEnumValue("MOST_SIMILAR")]
            _MOST_SIMILAR,

            /// <summary>
            /// <para>Least similar</para>
            /// <para>Least similar—Finds the features that are least similar.</para>
            /// <para>最不相似 - 查找最不相似的要素。</para>
            /// </summary>
            [Description("Least similar")]
            [GPEnumValue("LEAST_SIMILAR")]
            _LEAST_SIMILAR,

            /// <summary>
            /// <para>Both</para>
            /// <para>Both—Finds the features that are most similar and the features that are least similar.</para>
            /// <para>两者 （Both） - 查找最相似的要素和最不相似的要素。</para>
            /// </summary>
            [Description("Both")]
            [GPEnumValue("BOTH")]
            _BOTH,

        }

        /// <summary>
        /// <para>Match Method</para>
        /// <para><xdoc>
        ///   <para>Specifies whether matches will be based on values or cosine relationships.</para>
        ///   <bulletList>
        ///     <bullet_item>Attribute values—Similarity or dissimilarity will be based on the sum of squared standardized attribute value differences for all the Analysis Fields attributes.</bullet_item><para/>
        ///     <bullet_item>Attribute profiles—Similarity or dissimilarity will be computed as a function of cosine similarity for all the Analysis Fields attributes.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定匹配是基于值还是余弦关系。</para>
        ///   <bulletList>
        ///     <bullet_item>属性值—相似性或不相似性将基于所有分析字段属性的标准化属性值差的平方和。</bullet_item><para/>
        ///     <bullet_item>属性剖面—相似性或不相似性将计算为所有分析字段属性的余弦相似度的函数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _match_method_value _match_method { get; set; } = _match_method_value._ATTRIBUTE_VALUES;

        public enum _match_method_value
        {
            /// <summary>
            /// <para>Attribute values</para>
            /// <para>Attribute values—Similarity or dissimilarity will be based on the sum of squared standardized attribute value differences for all the Analysis Fields attributes.</para>
            /// <para>属性值—相似性或不相似性将基于所有分析字段属性的标准化属性值差的平方和。</para>
            /// </summary>
            [Description("Attribute values")]
            [GPEnumValue("ATTRIBUTE_VALUES")]
            _ATTRIBUTE_VALUES,

            /// <summary>
            /// <para>Attribute profiles</para>
            /// <para>Attribute profiles—Similarity or dissimilarity will be computed as a function of cosine similarity for all the Analysis Fields attributes.</para>
            /// <para>属性剖面—相似性或不相似性将计算为所有分析字段属性的余弦相似度的函数。</para>
            /// </summary>
            [Description("Attribute profiles")]
            [GPEnumValue("ATTRIBUTE_PROFILES")]
            _ATTRIBUTE_PROFILES,

        }

        /// <summary>
        /// <para>Number Of Results</para>
        /// <para>The number of solution matches to be found. Entering zero or a number larger than the total number of Search Layer features will return rankings for all the candidate features, with a maximum of 10,000.</para>
        /// <para>要找到的解决方案匹配项数。输入零或大于搜索图层要素总数的数字将返回所有候选要素的排名，最多为 10,000。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number Of Results")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_of_results { get; set; } = 10;


        /// <summary>
        /// <para>Append Fields</para>
        /// <para>An optional list of attributes to include with the output. You can include a name identifier, categorical field, or date field, for example. These fields are not used to determine similarity; they are only included in the output parameter attributes for your reference. By default, all fields are added.</para>
        /// <para>要包含在输出中的可选属性列表。例如，您可以包括名称标识符、分类字段或日期字段。这些字段不用于确定相似性;它们仅包含在输出参数属性中，供您参考。默认情况下，将添加所有字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _append_fields { get; set; } = null;


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Data Store</para>
        /// <para><xdoc>
        ///   <para>Specifies the ArcGIS Data Store where the output will be saved. The default is Spatiotemporal big data store. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.</para>
        ///   <bulletList>
        ///     <bullet_item>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</bullet_item><para/>
        ///     <bullet_item>Relational data store—Output will be stored in a relational data store.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将保存输出的 ArcGIS Data Store。默认值为 Spatiotemporal 大数据存储。存储在时空大数据存储中的所有结果都将存储在 WGS84 中。存储在关系数据存储中的结果将保留其坐标系。</para>
        ///   <bulletList>
        ///     <bullet_item>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>关系数据存储 - 输出将存储在关系数据存储中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Data Store")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _data_store_value _data_store { get; set; } = _data_store_value._SPATIOTEMPORAL_DATA_STORE;

        public enum _data_store_value
        {
            /// <summary>
            /// <para>Spatiotemporal big data store</para>
            /// <para>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</para>
            /// <para>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</para>
            /// </summary>
            [Description("Spatiotemporal big data store")]
            [GPEnumValue("SPATIOTEMPORAL_DATA_STORE")]
            _SPATIOTEMPORAL_DATA_STORE,

            /// <summary>
            /// <para>Relational data store</para>
            /// <para>Relational data store—Output will be stored in a relational data store.</para>
            /// <para>关系数据存储 - 输出将存储在关系数据存储中。</para>
            /// </summary>
            [Description("Relational data store")]
            [GPEnumValue("RELATIONAL_DATA_STORE")]
            _RELATIONAL_DATA_STORE,

        }

        public FindSimilarLocations SetEnv(object extent = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}